package com.supermarket_project.mapper;

import com.supermarket_project.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CategoryMapper {

    List<Category> selectCategory();

    int addCategory(Category category);

    List<Category> primaryCategory();

    List<Category> pageCategory(int pageNum, int pageSize,
                                @Param("fatherId") Integer fatherId,
                                @Param("primary") String primary,
                                @Param("second") String second);

    List<Category> secondCategory(@Param("categoryId") Integer categoryId);

    int updateCategory(Category category);

    Category queryCategory(@Param("categoryId") Integer categoryId);


    List<Category> secondCategoryByPrimary(int fatherId);

    Integer selectCategoryByCategoryName(@Param("categoryName") String categoryName);

    int lockCategory(int categoryId, int status);

    List<Category> queryCategoryByFatherId(@Param("fatherId") Integer fatherId);
}
